package com.ruis.kotboot.common.base

import com.alibaba.fastjson.annotation.JSONField
import com.alibaba.fastjson.serializer.ToStringSerializer
import com.baomidou.mybatisplus.annotations.TableField
import com.baomidou.mybatisplus.annotations.TableId
import com.baomidou.mybatisplus.annotations.TableLogic
import com.baomidou.mybatisplus.enums.IdType
import java.io.Serializable
import java.util.*
import kotlin.collections.HashMap

/**
 * Created by mgr on 2017/12/27.
 */
abstract class RuisModel :Serializable{
    @JSONField(serializeUsing = ToStringSerializer::class)
    @TableId(type = IdType.ID_WORKER)
    var id:Long?=null
//    var ids:String?=null

    @JSONField(serializeUsing = ToStringSerializer::class)
    var createBy:Long?=null

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    var createDate: Date?=null

    @JSONField(serializeUsing = ToStringSerializer::class)
    var updateBy:Long?=null

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    var updateDate: Date?=null

    @JSONField(serialize=false)
    var remarks:String?=null

    @JSONField(serialize=false)
    @TableLogic(value = "1", delval = "0")
    var enable:Boolean?=true

    @TableField(exist = false)
    var map=HashMap<String,Any?>()

    open fun preHandle(){}
}